<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  
  <title>知识图谱：知识建模（三）RDFS/OWL 词汇表 | Rogerspy&#39;s Home</title>
  
  <meta name="keywords" content="Machine Learning, Deep Learning, NLP">
  
  

  
  <link rel="alternate" href="/atom.xml" title="Rogerspy's Home">
  

  <meta name="HandheldFriendly" content="True">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <!-- meta -->
  
  
  <meta name="theme-color" content="#FFFFFF">
  <meta name="msapplication-TileColor" content="#1BC3FB">
  <meta name="msapplication-config" content="https://cdn.jsdelivr.net/gh/xaoxuu/assets@master/favicon/favicons/browserconfig.xml">
  

  <!-- link -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css">
  
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-waves@0.7.6/dist/waves.min.css">
  
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.10.1/css/all.min.css">
  
  
  <link rel="shortcut icon" type="image/x-icon" href="https://cdn.jsdelivr.net/gh/xaoxuu/assets@master/favicon/favicon.ico">
  <link rel="icon" type="image/x-icon" sizes="32x32" href="https://cdn.jsdelivr.net/gh/xaoxuu/assets@master/favicon/favicons/favicon-32x32.png">
  <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="https://cdn.jsdelivr.net/gh/xaoxuu/assets@master/favicon/favicons/apple-touch-icon.png">
  <link rel="mask-icon" color="#1BC3FB" href="https://cdn.jsdelivr.net/gh/xaoxuu/assets@master/favicon/favicons/safari-pinned-tab.svg">
  <link rel="manifest" href="https://cdn.jsdelivr.net/gh/xaoxuu/assets@master/favicon/favicons/site.webmanifest">
  

  

  
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.5/css/style.css">
  

  <script>
    function setLoadingBarProgress(num) {
      document.getElementById('loading-bar').style.width=num+"%";
    }
  </script>
  

  
  
  <!-- 时间线 -->
  <link rel="stylesheet" href="/css/timeline.css">
  <!-- 血小板-->
  <link rel="stylesheet" href="/live2d/css/live2d.css">
  <style>
	.article p .mjx-math {
	    font-family: Menlo,Monaco,courier,monospace,"Lucida Console",'Source Code Pro',"Microsoft YaHei",Helvetica,Arial,sans-serif,Ubuntu;
        background: none;
        padding: 2px;
        border-radius: 4px;
	}
  </style>
</head>

<body>
  
  
  <header class="l_header pure">
  <div id="loading-bar-wrapper">
    <div id="loading-bar" class="pure"></div>
  </div>

	<div class='wrapper'>
		<div class="nav-main container container--flex">
      <a class="logo flat-box" href='/' >
        
          Rogerspy's Home
        
      </a>
			<div class='menu navgation'>
				<ul class='h-list'>
          
  					
  						<li>
								<a class="nav flat-box" href="/blog/"
                  
                  
                  id="blog">
									<i class='fas fa-edit fa-fw'></i>&nbsp;博客
								</a>
							</li>
      			
  						<li>
								<a class="nav flat-box" href="/video/"
                  
                  
                  id="video">
									<i class='fas fa-film fa-fw'></i>&nbsp;视频小站
								</a>
							</li>
      			
  						<li>
								<a class="nav flat-box" href="/material/"
                  
                  
                  id="material">
									<i class='fas fa-briefcase fa-fw'></i>&nbsp;学习资料
								</a>
							</li>
      			
  						<li>
								<a class="nav flat-box" href="/diary/"
                  
                  
                  id="diary">
									<i class='fas fa-book fa-fw'></i>&nbsp;随心记
								</a>
							</li>
      			
  						<li>
								<a class="nav flat-box" href="/categories/"
                  
                    rel="nofollow"
                  
                  
                  id="categories">
									<i class='fas fa-folder-open fa-fw'></i>&nbsp;分类
								</a>
							</li>
      			
  						<li>
								<a class="nav flat-box" href="/tags/"
                  
                    rel="nofollow"
                  
                  
                  id="tags">
									<i class='fas fa-hashtag fa-fw'></i>&nbsp;标签
								</a>
							</li>
      			
  						<li>
								<a class="nav flat-box" href="/blog/archives/"
                  
                    rel="nofollow"
                  
                  
                  id="blogarchives">
									<i class='fas fa-archive fa-fw'></i>&nbsp;归档
								</a>
							</li>
      			
      		
				</ul>
			</div>

			
				<div class="m_search">
					<form name="searchform" class="form u-search-form">
						<input type="text" class="input u-search-input" placeholder="搜索" />
						<i class="icon fas fa-search fa-fw"></i>
					</form>
				</div>
			
			<ul class='switcher h-list'>
				
					<li class='s-search'><a class="fas fa-search fa-fw" href='javascript:void(0)'></a></li>
				
				<li class='s-menu'><a class="fas fa-bars fa-fw" href='javascript:void(0)'></a></li>
			</ul>
		</div>

		<div class='nav-sub container container--flex'>
			<a class="logo flat-box"></a>
			<ul class='switcher h-list'>
				<li class='s-comment'><a class="flat-btn fas fa-comments fa-fw" href='javascript:void(0)'></a></li>
        
          <li class='s-toc'><a class="flat-btn fas fa-list fa-fw" href='javascript:void(0)'></a></li>
        
			</ul>
		</div>
	</div>
</header>
	<aside class="menu-phone">
    <header>
		<nav class="menu navgation">
      <ul>
        
          
            <li>
							<a class="nav flat-box" href="/"
                
                
                id="home">
								<i class='fas fa-clock fa-fw'></i>&nbsp;近期文章
							</a>
            </li>
          
            <li>
							<a class="nav flat-box" href="/blog/archives/"
                
                  rel="nofollow"
                
                
                id="blogarchives">
								<i class='fas fa-archive fa-fw'></i>&nbsp;文章归档
							</a>
            </li>
          
            <li>
							<a class="nav flat-box" href="/blog/"
                
                
                id="blog">
								<i class='fas fa-edit fa-fw'></i>&nbsp;我的博客
							</a>
            </li>
          
            <li>
							<a class="nav flat-box" href="/video/"
                
                  rel="nofollow"
                
                
                id="video">
								<i class='fas fa-film fa-fw'></i>&nbsp;我的视频
							</a>
            </li>
          
            <li>
							<a class="nav flat-box" href="/material/"
                
                  rel="nofollow"
                
                
                id="material">
								<i class='fas fa-briefcase fa-fw'></i>&nbsp;学习资料
							</a>
            </li>
          
            <li>
							<a class="nav flat-box" href="/about/"
                
                  rel="nofollow"
                
                
                id="about">
								<i class='fas fa-info-circle fa-fw'></i>&nbsp;关于小站
							</a>
            </li>
          
       
      </ul>
		</nav>
    </header>
	</aside>
<script>setLoadingBarProgress(40);</script>



  <div class="l_body nocover">
    <div class='body-wrapper'>
      <div class='l_main'>
  

  
    <article id="post" class="post white-box article-type-post" itemscope itemprop="blogPost">
      


  <section class='meta'>
    
    
    <div class="meta" id="header-meta">
      
        
  
    <h1 class="title">
      <a href="/2021/08/26/kg-rdf-vocabulary/">
        知识图谱：知识建模（三）RDFS/OWL 词汇表
      </a>
    </h1>
  


      
      <div class='new-meta-box'>
        
          
        
          
            
  <div class='new-meta-item author'>
    <a href="https://rogerspy.gitee.io" rel="nofollow">
      
        <i class="fas fa-user" aria-hidden="true"></i>
      
      <p>Rogerspy</p>
    </a>
  </div>


          
        
          
            <div class="new-meta-item date">
  <a class='notlink'>
    <i class="fas fa-calendar-alt" aria-hidden="true"></i>
    <p>2021-08-26</p>
  </a>
</div>

          
        
          
            
  
  <div class='new-meta-item category'>
    <a href='/categories/知识图谱/' rel="nofollow">
      <i class="fas fa-folder-open" aria-hidden="true"></i>
      <p>知识图谱</p>
    </a>
  </div>


          
        
          
            
  
    <div class="new-meta-item browse busuanzi">
      <a class='notlink'>
        <i class="fas fa-eye" aria-hidden="true"></i>
        <p>
          <span id="busuanzi_value_page_pv">
            <i class="fas fa-spinner fa-spin fa-fw" aria-hidden="true"></i>
          </span>
        </p>
      </a>
    </div>
  


          
        
          
            

          
        
          
            
  
    <div style="margin-right: 10px;">
      <span class="post-time">
        <span class="post-meta-item-icon">
          <i class="fa fa-keyboard"></i>
          <span class="post-meta-item-text">  字数统计: </span>
          <span class="post-count">7k字</span>
        </span>
      </span>
      &nbsp; | &nbsp;
      <span class="post-time">
        <span class="post-meta-item-icon">
          <i class="fa fa-hourglass-half"></i>
          <span class="post-meta-item-text">  阅读时长≈</span>
          <span class="post-count">30分</span>
        </span>
      </span>
    </div>
  

          
        
      </div>
      
        <hr>
      
    </div>
  </section>


      <section class="article typo">
        <div class="article-entry" itemprop="articleBody">
          <p><img src="https://cdn.jsdelivr.net/gh/rogerspy/blog-imgs/blog-imgs/kgicon.png" alt></p>
<p>前面的文章介绍了知识建模，我们提到知识建模使用的是 RDF 知识表示法，而 RDFS 本质上是一个标准化语义词汇表。所以本文总结一些常用的 RDFS/OWL 的语义词汇。</p>
<a id="more"></a>
<h1 id="0-絮絮叨叨"><a href="#0-絮絮叨叨" class="headerlink" title="0. 絮絮叨叨"></a>0. 絮絮叨叨</h1><h2 id="0-1-RDF-XML"><a href="#0-1-RDF-XML" class="headerlink" title="0.1 RDF/XML"></a>0.1 RDF/XML</h2><p>在正式介绍 RDFS/OWL 词汇之前，相信很多小伙伴在看知识建模的时候就会有很多疑问。为什么一定要用 RDF？XML 好像也能胜任这份工作，RDF 和 XML 的区别是什么？RDF 标榜的让计算机理解语义体现在哪里？等等一系列的疑问。当然回答这些问题并不是本文的目的，本文只是总结 RDFS/OWL 的词汇。要想弄明白 RDF 到底是怎么一回事，这里推荐一些必读的书籍/文献，希望能帮助到有疑问的人。</p>
<ul>
<li><a href="http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=08AF5BC897E861F62FE3800830B02E22?doi=10.1.1.91.8164&amp;rep=rep1&amp;type=pdf" target="_blank" rel="noopener"> Where are the Semantics in the Semantic Web?</a>, <em>Michael Uschold</em></li>
<li><a href="https://www.w3.org/DesignIssues/RDF-XML.html" target="_blank" rel="noopener">Why RDF model is different from the XML model</a>, <em>Tim Berners-Lee</em></li>
<li><a href="https://www.researchgate.net/publication/279393307_A_Developer%27s_Guide_to_the_Semantic_Web" target="_blank" rel="noopener">A developer’s guide to semantic web</a>, <em>Liyang Yu</em></li>
<li><a href="http://www-900.ibm.com/developerWorks/cn/xml/x-xmlrdf/index.shtml#authorname" target="_blank" rel="noopener">XML+RDF——实现Web数据基于语义的描述</a>, <em>周竞涛、王明微</em></li>
</ul>
<h2 id="0-2-IRI-URI-URL-URN-的区别"><a href="#0-2-IRI-URI-URL-URN-的区别" class="headerlink" title="0.2 IRI, URI, URL, URN 的区别"></a>0.2 IRI, URI, URL, URN 的区别</h2><ul>
<li><p>URL</p>
<p><strong>Uniform Resource Locator</strong>，统一资源定位符。是用于在网络中传播和访问互联网资源的一个地址，只有通过特定的地址才能够访问的指定的资源或者网页，简而言之就是我们所说的网址，当然这样有些不太恰当，但是确实最容易被理解的，就如你必须通过 <code>https://www.baidu.com</code> 才能访问百度搜索页面，通过其他的链接都是不行的，这个地址就被称之为 URL。</p>
</li>
<li><p>URI</p>
<p><strong>Uniform Resource Identifier</strong>，统一资源标识符。也可以理解为标识、定位资源的字符串。字符集仅限于 US-ASCII 中（额外加一个百分号 %）， 不包括某些保留字符。URI 可用作定位器、名称或两者。 如果 URI 是定位器，则它描述了资源的主要访问机制。 如果一个 URI 是一个名称，它通过给它一个唯一的名称来标识一个资源。 许多人容易将 URL 和 URI 两者混淆，其实两者非常相似，但是也有所不同。URL 包含相对地址和绝对地址，URI 就属于绝对地址，所以 URL 包含 URI，简单的举例就是很多的网站可能都有 <code>/about</code> 这个路径，但是不同的域名或者 IP 访问到的就是不同的资源页面，所以这就只是一个标识，并不能标识其具体未知或者唯一性。</p>
</li>
<li><p>IRI</p>
<p><strong>Internationalized Resource Identifier</strong>，国际化资源标识符。和 URI 类似，区别在于 URI 使用的字符集有限制，所以没有办法兼容不同的文字语言，所以 IRI 就引入了 Unicode 字符来解决这个兼容问题，最后就有了国际化资源标识符（IRI）。</p>
</li>
<li><p>URN</p>
<p><strong>Uniform Resource Name</strong>，统一资源名称。旨在用作持久的，与位置无关的资源标识符。URN 可以提供一种机制，用于查找和检索定义特定命名空间的架构文件。尽管普通的 URL 可以提供类似的功能，但是在这方面，URN 更加强大并且更容易管理，因为 URN 可以引用多个 URL。子凡举个最简单的例子大家就明白了，那就是：磁力链接，它就是 URN 的一种实现，可以持久化的标识一个 BT 资源，资源分布式的存储在 P2P 网络中，无需中心服务器用户即可找到并下载它。</p>
</li>
</ul>
<p>总结一下：</p>
<div class="container" style="margin-top:40px;margin-bottom:20px;">
    <div style="background-color:#54c7ec;height:36px;line-height:36px;vertical-align:middle;">
        <div style="margin-left:10px">
            <font color="white" size="4">
                • SUMMARY
            </font>
        </div>
    </div>
    <div style="background-color:#F3F4F7">
        <div style="padding:15px 10px 15px 20px;line-height:1.5;">
            • IRI ⊃ URI <br>
            • URI ⊃ URL <br>
            • URI ⊃ URN <br>
            • URL ∩ URN = ∅ 
        </div>    
    </div>    
</div>

<p>下面就进入今天的正题——RDFS/OWL 词汇表。本文摘自 <em>《语义网技术体系》 [瞿裕忠，胡伟，程龚 编著] 2015年版</em> 这本书。想查看完整版词汇表，可前往这两个网页：</p>
<ul>
<li><a href="https://www.w3.org/TR/rdf-schema/" target="_blank" rel="noopener">RDF Schema 1.1</a> </li>
<li><a href="https://www.w3.org/TR/2004/REC-owl-ref-20040210/" target="_blank" rel="noopener">OWL Web Ontology Language</a></li>
</ul>
<p>再啰嗦一句，除了以上两个 RDF 词汇表，还有一个 <a href="http://xmlns.com/foaf/spec/" target="_blank" rel="noopener">FOAF</a> 词汇表在对人物进行建模的时候通常会用到。但是这里就不再介绍，想了解更多可自行前往。</p>
<h1 id="1-序言"><a href="#1-序言" class="headerlink" title="1. 序言"></a>1. 序言</h1><p>RDF Schema（下文简称 RDFS） 是 RDF 词汇表的一个扩展版本（RDF 本身是一个知识表示模型，但同时也是一个词汇表）。RDFS 承认有许多技术可以用来描述类和属性的含义，例如 OWL。</p>
<p>本文中定义的语言由一组 RDF 资源组成，这些资源可用于在特定于应用程序的 RDF 词汇表中描述其他 RDF 资源。核心词汇 <code>rdfs</code> 非正式地称为命名空间中定义。该命名空间由 IRI 标识：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">http://www.w3.org/2000/01/rdf-schema#</span><br></pre></td></tr></table></figure>
<p>并且通常与前缀相关联 <code>rdfs:</code>。本规范还使用前缀 <code>rdf:</code>来指代 RDF 命名空间：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">http://www.w3.org/1999/02/22-rdf-syntax-ns#</span><br></pre></td></tr></table></figure>
<p>为了方便和可读性，本规范使用缩写形式来表示 IRI。形式 <code>prefix:suffix</code> 的名称应该被解释为一个 IRI，它由与后缀连接的前缀相关联的 IRI 组成。</p>
<h1 id="2-RDFS"><a href="#2-RDFS" class="headerlink" title="2. RDFS"></a>2. RDFS</h1><p>资源可以被分成不同的组，这些组称之为“类”（classes）。每个类别下包含的成员称之为“实例”。比如“人”是一个类，“张三”是一个“人”的实例。通常我们把 RDF 和 RDFS 合写成 RDF(S) 或 RDF/S。</p>
<p>下面分别介绍 RDF(S) 的核心词汇。</p>
<h2 id="2-1-Classes"><a href="#2-1-Classes" class="headerlink" title="2.1 Classes"></a>2.1 Classes</h2><p>资源可以分成不同的组，这些组就称之为“类”，组内的成员就称之为类的“实例”。我们用 IRI 来标识类，然后用 RDF 属性来描述类。两个不同的类可能有相同的实例，比如“张三”既可以是“导演”这个类，也可以是“演员”这个类。一个类也可能是他自己的实例。</p>
<blockquote>
<p>名词解释：“类的外延”</p>
<p>与一个类别相关的集合，我们称之为类的外延。类的外延集合中的每个成员都是类的实例。举个例子：</p>
<p>类：食物</p>
<p>类的外延：a = {鸡，鸭，鱼，肉}</p>
<p>类的实例：鸡，鸭，鱼，肉</p>
<p>例子中，“食物”作为一个类别，表示一个抽象概念。跟这个类别相关的一个集合 a 表示“食物”的外延，相对类来说类的外延是具体的概念。但是要注意 a 作为一个集合整体出现。而 a 中的每一个元素称之为实例。</p>
<p>当我们说“鸡肉是一种食物”的时候，实际上是表明“鸡肉”是“食物”这个概念的外延集合中的一员。</p>
<script type="math/tex; mode=display">
\text{instance} \in a \rightarrow class</script></blockquote>
<h3 id="2-1-1-rdf-Resource"><a href="#2-1-1-rdf-Resource" class="headerlink" title="2.1.1 rdf:Resource"></a>2.1.1 rdf:Resource</h3><p>所有 RDF 描述的事物都是资源，即都是 <code>rdfs:Resource</code> 的实例。这是所有事物的类，其他所有类都是它的子类。<code>rdfs:Resource</code> 也是 <code>rdfs:Class</code> 的实例。</p>
<h3 id="2-1-2-rdf-Class"><a href="#2-1-2-rdf-Class" class="headerlink" title="2.1.2 rdf:Class"></a>2.1.2 rdf:Class</h3><p>对应“类”的概念，即资源的类。当定义一个新类的时候，表示该类的资源必须有一个 <code>rdf:type</code> 属性，属性值是 <code>rdfs:Class</code>。比如定义“导演”是一个新类，那么我们必须定义：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">导演 rdf:type rdfs:Class</span><br></pre></td></tr></table></figure>
<p>注意，如上所述，一个实例可能属于多个类，所以类成员是不互斥的。<code>rdfs:Class</code> 是 <code>rdfs:Class</code> 是实例。</p>
<h3 id="2-1-3-rdf-Literal"><a href="#2-1-3-rdf-Literal" class="headerlink" title="2.1.3 rdf:Literal"></a>2.1.3 rdf:Literal</h3><p><code>rdf:Literal</code> 表示类或属性的字面量类型，比如数字、字符串等。<code>rdfs:Literal</code> 是 <code>rdfs:Class</code> 的实例，同时也是 <code>rdfs:Resource</code> 的子类。</p>
<h3 id="2-1-4-rdfs-Property"><a href="#2-1-4-rdfs-Property" class="headerlink" title="2.1.4 rdfs:Property"></a>2.1.4 rdfs:Property</h3><p><code>rdfs:Property</code> 是 RDF 属性类，同时也是 <code>rdfs:Class</code> 的实例。</p>
<h2 id="2-2-Properties"><a href="#2-2-Properties" class="headerlink" title="2.2.  Properties"></a>2.2.  Properties</h2><p>在 RDF 中，RDF 属性表示 subject 资源和 object 资源之间的关系。为了下文解释方便，我们这里写下三元组的一般形式：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">subject predicate object</span><br></pre></td></tr></table></figure>
<h2 id="2-2-1-rdfs-range"><a href="#2-2-1-rdfs-range" class="headerlink" title="2.2.1 rdfs:range"></a>2.2.1 rdfs:range</h2><p><code>rdfs:range</code> 是 <code>rdfs:Property</code> 的一个实例，用来指明一个属性的值域。例如三元组：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">p rdfs:range c</span><br></pre></td></tr></table></figure>
<p>表示 p 是 <code>rdfs:range</code> 的一个实例， c 是 <code>rdfs:Class</code>  的一个实例。上面的三元组描述的是一个 predicate 是 p 的 object 是 c 的实例。</p>
<h3 id="2-2-2-rdfs-domain"><a href="#2-2-2-rdfs-domain" class="headerlink" title="2.2.2 rdfs:domain"></a>2.2.2 rdfs:domain</h3><p><code>rdfs:domain</code> 是 <code>rdfs:Property</code> 的一个实例，用来指明一个属性的定义域。例如三元组：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">p rdfs:domain c</span><br></pre></td></tr></table></figure>
<p>表示 p 是 <code>rdfs:Property</code> 的一个实例，c 是 <code>rdfs:Class</code> 的实例。上面的三元组描述的是一个 predicate 是 p 的 subject 是 c 的实例。</p>
<p>其中，如果 p 有不止一个 <code>rdfs:domain</code> ，那么其对应的所有 subject 都是 c 的实例。</p>
<p>举个例子：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">人 吃 食物  </span><br><span class="line"></span><br><span class="line">吃 rdf:type rdfs:Property</span><br><span class="line">吃 rdfs:domain 人</span><br><span class="line">吃 rdfs:range 食物</span><br></pre></td></tr></table></figure>
<p>翻译过来就是，“吃”表示一种属性（关系），它的主语是“人”，宾语是“食物”。</p>
<h3 id="2-2-3-rdf-type"><a href="#2-2-3-rdf-type" class="headerlink" title="2.2.3 rdf:type"></a>2.2.3 rdf:type</h3><p><code>rdf:type</code> 是 <code>rdf:Property</code> 的一个实例，用于描述一个资源是类的实例，例如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">R rdf:type C</span><br></pre></td></tr></table></figure>
<p>表示 C 是 <code>rdfs:Class</code> 的子类，并且 R 是 C 的实例。用一句通俗易懂的话就是，R 是一种 C，比如 <code>人 rdf:type 生物</code> 表示“人是一种动物”。实际上 <code>rdf:type</code> 表示 “is-a” 的关系，可以简写成 <code>a</code>。</p>
<h3 id="2-2-4-rdfs-subClassOf"><a href="#2-2-4-rdfs-subClassOf" class="headerlink" title="2.2.4 rdfs:subClassOf"></a>2.2.4 rdfs:subClassOf</h3><p><code>rdfs:subClassOf</code> 是 <code>rdfs:Property</code>  的一个实例，用来指明一个类的所有实例也是另一个类的实例，比如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">C1 rdfs:subClassOf C2</span><br></pre></td></tr></table></figure>
<p>描述的是，C1 是 <code>rdfs:Class</code> 的一个实例，C2 是 <code>rdfs:Class</code> 的一个实例，并且 C1 是 C2 的一个子类。<code>rdfs:subClassOf</code> 是可传递的，即如果 a 是 b 的子类，b 是 c 的子类，那么 a 也是 c 的子类。</p>
<p><code>rdfs:subClassOf</code> 的 <code>rdfs:domain</code> 是 <code>rdfs:Class</code>。<code>rdfs:subClassOf</code> 的 <code>rdfs:range</code> 是 <code>rdfs:Class</code>。</p>
<h3 id="2-2-5-rdfs-subPropertyOf"><a href="#2-2-5-rdfs-subPropertyOf" class="headerlink" title="2.2.5 rdfs:subPropertyOf"></a>2.2.5 rdfs:subPropertyOf</h3><p><code>rdfs:subPropertyOf</code> 是 <code>rdfs:Property</code> 的一个实例，用来指明与一个资源相关的所有属性也与另一个资源相关，比如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">P1 rdfs:subPropertyOf P2</span><br></pre></td></tr></table></figure>
<p>描述了 P1 是 <code>rdfs:Property</code> 的一个实例，P2 也是 <code>rdfs:Property</code> 的一个实例，并且 P1 是 P2 的一个子属性。<code>rdfs:subPropertyOf</code> 是可传递性的。</p>
<p><code>rdfs:subPropertyOf</code> 的 <code>rdfs:domain</code> 是 <code>rdf:Property</code>。<code>rdfs:subPropertyOf</code> 的 <code>rdfs:range</code> 是 <code>rdf:Property</code>。</p>
<p>除了上面介绍的词之外， RD(S) 还有很多其他有用的词汇，这里不一一列举。下图展示了 RDF(S) 各个词汇之间的关系：</p>
<p> <img src="https://cdn.jsdelivr.net/gh/rogerspy/blog-imgs/blog-imgs/20210830172323.png" alt></p>
<h3 id="2-2-6-RDFS-词汇总结"><a href="#2-2-6-RDFS-词汇总结" class="headerlink" title="2.2.6 RDFS 词汇总结"></a>2.2.6 RDFS 词汇总结</h3><h4 id="2-2-6-1-Classes"><a href="#2-2-6-1-Classes" class="headerlink" title="2.2.6.1 Classes"></a>2.2.6.1 Classes</h4><div class="table-container">
<table>
<thead>
<tr>
<th>Class name</th>
<th>comment</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_resource" target="_blank" rel="noopener">rdfs:Resource</a></td>
<td>The class resource, everything.</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_literal" target="_blank" rel="noopener">rdfs:Literal</a></td>
<td>The class of literal values, e.g. textual strings and integers.</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_langstring" target="_blank" rel="noopener">rdf:langString</a></td>
<td>The class of language-tagged string literal values.</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_html" target="_blank" rel="noopener">rdf:HTML</a></td>
<td>The class of HTML literal values.</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_xmlliteral" target="_blank" rel="noopener">rdf:XMLLiteral</a></td>
<td>The class of XML literal values.</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_class" target="_blank" rel="noopener">rdfs:Class</a></td>
<td>The class of classes.</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_property" target="_blank" rel="noopener">rdf:Property</a></td>
<td>The class of RDF properties.</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_datatype" target="_blank" rel="noopener">rdfs:Datatype</a></td>
<td>The class of RDF datatypes.</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_statement" target="_blank" rel="noopener">rdf:Statement</a></td>
<td>The class of RDF statements.</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_bag" target="_blank" rel="noopener">rdf:Bag</a></td>
<td>The class of unordered containers.</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_seq" target="_blank" rel="noopener">rdf:Seq</a></td>
<td>The class of ordered containers.</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_alt" target="_blank" rel="noopener">rdf:Alt</a></td>
<td>The class of containers of alternatives.</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_container" target="_blank" rel="noopener">rdfs:Container</a></td>
<td>The class of RDF containers.</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_containermembershipproperty" target="_blank" rel="noopener">rdfs:ContainerMembershipProperty</a></td>
<td>The class of container membership properties, rdf:_1, rdf:_2, …, all of which are sub-properties of ‘member’.</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_list" target="_blank" rel="noopener">rdf:List</a></td>
<td>The class of RDF Lists.</td>
</tr>
</tbody>
</table>
</div>
<h4 id="2-2-6-2-Properties"><a href="#2-2-6-2-Properties" class="headerlink" title="2.2.6.2 Properties"></a>2.2.6.2 Properties</h4><div class="table-container">
<table>
<thead>
<tr>
<th>Property name</th>
<th>comment</th>
<th>domain</th>
<th>range</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_type" target="_blank" rel="noopener">rdf:type</a></td>
<td>The subject is an instance of a class.</td>
<td>rdfs:Resource</td>
<td>rdfs:Class</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_subclassof" target="_blank" rel="noopener">rdfs:subClassOf</a></td>
<td>The subject is a subclass of a class.</td>
<td>rdfs:Class</td>
<td>rdfs:Class</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_subpropertyof" target="_blank" rel="noopener">rdfs:subPropertyOf</a></td>
<td>The subject is a subproperty of a property.</td>
<td>rdf:Property</td>
<td>rdf:Property</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_domain" target="_blank" rel="noopener">rdfs:domain</a></td>
<td>A domain of the subject property.</td>
<td>rdf:Property</td>
<td>rdfs:Class</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_range" target="_blank" rel="noopener">rdfs:range</a></td>
<td>A range of the subject property.</td>
<td>rdf:Property</td>
<td>rdfs:Class</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_label" target="_blank" rel="noopener">rdfs:label</a></td>
<td>A human-readable name for the subject.</td>
<td>rdfs:Resource</td>
<td>rdfs:Literal</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_comment" target="_blank" rel="noopener">rdfs:comment</a></td>
<td>A description of the subject resource.</td>
<td>rdfs:Resource</td>
<td>rdfs:Literal</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_member" target="_blank" rel="noopener">rdfs:member</a></td>
<td>A member of the subject resource.</td>
<td>rdfs:Resource</td>
<td>rdfs:Resource</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_first" target="_blank" rel="noopener">rdf:first</a></td>
<td>The first item in the subject RDF list.</td>
<td>rdf:List</td>
<td>rdfs:Resource</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_rest" target="_blank" rel="noopener">rdf:rest</a></td>
<td>The rest of the subject RDF list after the first item.</td>
<td>rdf:List</td>
<td>rdf:List</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_seealso" target="_blank" rel="noopener">rdfs:seeAlso</a></td>
<td>Further information about the subject resource.</td>
<td>rdfs:Resource</td>
<td>rdfs:Resource</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_isdefinedby" target="_blank" rel="noopener">rdfs:isDefinedBy</a></td>
<td>The definition of the subject resource.</td>
<td>rdfs:Resource</td>
<td>rdfs:Resource</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_value" target="_blank" rel="noopener">rdf:value</a></td>
<td>Idiomatic property used for structured values.</td>
<td>rdfs:Resource</td>
<td>rdfs:Resource</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_subject" target="_blank" rel="noopener">rdf:subject</a></td>
<td>The subject of the subject RDF statement.</td>
<td>rdf:Statement</td>
<td>rdfs:Resource</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_predicate" target="_blank" rel="noopener">rdf:predicate</a></td>
<td>The predicate of the subject RDF statement.</td>
<td>rdf:Statement</td>
<td>rdfs:Resource</td>
</tr>
<tr>
<td><a href="https://www.w3.org/TR/rdf-schema/#ch_object" target="_blank" rel="noopener">rdf:object</a></td>
<td>The object of the subject RDF statement.</td>
<td>rdf:Statement</td>
<td>rdfs:Resource</td>
</tr>
</tbody>
</table>
</div>
<h1 id="3-OWL"><a href="#3-OWL" class="headerlink" title="3. OWL"></a>3. OWL</h1><p>由于 RDFS 的表达能力较弱，W3C 2004 年又发布了 Web Ontology Language（OWL）进一步提供更加丰富的知识表示和推理能力。OWL 以描述逻辑为理论基础，可以将概念和属于用结构化的形式表示出来。通过 RDF 中的链接可以是本体分布在不同的系统中，充分体现了其标准化，开放性，扩展性以及适应性。现在 OWL 已经是 W3C 推荐的本体建模标准。OWL 的命名空间是：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">http://www.w3.org/2002/07/owl#</span><br></pre></td></tr></table></figure>
<p>OWL 提供 3 中表达能力不同的子语言：OWL Full，OWL DL，OWL Lite。其中任意一个都可以映射成一个完整的 RDF 图。</p>
<ul>
<li>OWL Full。完全兼容 RDFS，但超出经典一阶逻辑的范畴。与 OWL Full 相关的推理工具现在还在探索中。</li>
<li>OWL DL。是 OWL Full 的一个子集，表达能力相对较强，可以有效的支持逻辑推理，但不是完全兼容 RDFS。</li>
<li>OWL Lite。在 OWL DL 的基础上对允许使用公理做了进一步的限制。</li>
</ul>
<p>到了 2012 年，W3C 对原先版本的 OWL 进行了修订，发布新的 OWL 版本——OWL 2。OWL 2 对 OWL 向后兼容，包含了 3 个指定的概图：</p>
<ul>
<li>OWL 2 EL。允许以高效的多项式时间算法对类型的可满足性检查、分类和实例检查并进行推理，特别适合使用含有大量属性或类本体的应用。</li>
<li>OWL 2 QL。允许使用传统的关系数据库实现查询问答，特别适合使用大量实例数据并且以查询问答作为主要推理任务的应用。</li>
<li>OWL 2 RL。允许以一种比较直接的方式，使用基于规则的推理引擎，在不牺牲太多的表达能力的情况下实现大规模推理。</li>
</ul>
<h2 id="3-1-OWL-Document"><a href="#3-1-OWL-Document" class="headerlink" title="3.1 OWL Document"></a>3.1 OWL Document</h2><p>一般情况下，描述本体的文档都包含本体本身的信息。一个本体是一个资源，可以采用 OWL 和其他命名空间属性进行描述。这些描述被称为本体头部，通常位于本体文档的开始部分。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">&lt;?xml version=&quot;1.0&quot;?&gt;</span><br><span class="line">&lt;rdf:RDF xmlns=&quot;http://www.semanticweb.org/qiuji/ontologies/2017/9/untitled-ontology-2#&quot;</span><br><span class="line">     xml:base=&quot;http://www.semanticweb.org/qiuji/ontologies/2017/9/untitled-ontology-2&quot;</span><br><span class="line">     xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;</span><br><span class="line">     xmlns:owl=&quot;http://www.w3.org/2002/07/owl#&quot;</span><br><span class="line">     xmlns:xml=&quot;http://www.w3.org/XML/1998/namespace&quot;</span><br><span class="line">     xmlns:untitled-ontology-22=&quot;http://www.semanticweb.org/ontologies/2017/9/untitled-ontology-2#&quot;</span><br><span class="line">     xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema#&quot;</span><br><span class="line">     xmlns:untitled-ontology-2=&quot;http://www.semanticweb.org/qiuji/ontologies/2017/9/untitled-ontology-2#&quot;</span><br><span class="line">     xmlns:rdfs=&quot;http://www.w3.org/2000/01/rdf-schema#&quot;&gt;</span><br><span class="line">    &lt;owl:Ontology rdf:about=&quot;http://www.semanticweb.org/ontologies/2017/9/untitled-ontology-2&quot;/&gt;</span><br></pre></td></tr></table></figure>
<h3 id="3-1-1-owl-imports"><a href="#3-1-1-owl-imports" class="headerlink" title="3.1.1 owl:imports"></a>3.1.1 owl:imports</h3><p>允许引用另一个包含定义的 OWL 本体，并将其含义作为定义本体的一部分。每个引用都包含一个 URI，它指向被导入的本体。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">@prefix : &lt;http://example.com/pwl/families/&gt; .</span><br><span class="line">@prefix otherOnt: &lt;http/example.org/otherOntologies/families/&gt; .</span><br><span class="line">@prefix owl: &lt;http://www.w3.org/2002/07/owl#&gt; .</span><br><span class="line">@prefix rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt; .</span><br><span class="line">@prefix rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;</span><br><span class="line"></span><br><span class="line">&lt;http://example.com/pwl/families/&gt;</span><br><span class="line">    rdf:type owlOntology ;</span><br><span class="line">    owl:imports &lt;http/example.org/otherOntologies/families.owl&gt; .</span><br></pre></td></tr></table></figure>
<p>另外，还可以在本体头部添加有关版本的一些信息。相关属性包括：<code>owl:versionInfo</code>，<code>owl:priorVersion</code>，<code>owl:backwardCompatibleWith</code>，<code>owl:incompatibleWith</code> 等等。</p>
<h2 id="3-2-OWL-Classes"><a href="#3-2-OWL-Classes" class="headerlink" title="3.2 OWL Classes"></a>3.2 OWL Classes</h2><p>与 RDFS 类似， OWL 也有“类”的概念，也是表示我们对资源的分组，也有“类的外延”等概念。需要注意的是，在OWL 中，类的外延中的元素称之为个体（individual），和在 Protege 建模工具菜单栏中的 individual 是同一概念，都表示实例。</p>
<div class="container" style="margin-top:40px;margin-bottom:20px;">
    <div style="background-color:#54c7ec;height:36px;line-height:36px;vertical-align:middle;">
        <div style="margin-left:10px">
            <font color="white" size="4">
                • NOTE
            </font>
        </div>
    </div>
    <div style="background-color:#F3F4F7">
        <div style="padding:15px 10px 15px 20px;line-height:1.5;">
            OWL DL 和 OWL DL 中的资源不能同时是个体（individual）和类（class），即 class 和 individual 是互斥的。
            另外，rdfs:Class 和 rdfs:Property 是被禁止使用的。
        </div>    
    </div>    
</div>

<p>从上面的介绍来看，OWL 被设计出来主要是对 RDFS  的逻辑推理能力进行补强。要进行推理我们首先要有一些公理。在 OWL 中采用“类描述”对 OWL 类进行解释描述，然后将 OWL 组合成类公理。</p>
<h3 id="3-2-1-类描述（class-description）"><a href="#3-2-1-类描述（class-description）" class="headerlink" title="3.2.1 类描述（class description）"></a>3.2.1 类描述（class description）</h3><p>类描述通过类名或通过指定未命名匿名类的类外延来描述 OWL 类。OWL 中有 6 中不同的类描述：</p>
<ol>
<li>类标识符（URI）</li>
<li>穷举组成一个类的个体（enumeration）</li>
<li>属性限制（property restriction）</li>
<li>多个类描述的交集（intersection）</li>
<li>多个类描述的并集（union）</li>
<li>一个类描述的补集（complement）</li>
</ol>
<p>类标识符相当于通过类名（URI）来描述一个类；穷举表示一个类包含可穷举的个体；一个类中的所有个体都要满足特定的属性限制。对于 4、5、6 来说，可以认为是逻辑与（AND）或（OR）非（NOT）操作。</p>
<h4 id="3-2-1-1-owl-Class"><a href="#3-2-1-1-owl-Class" class="headerlink" title="3.2.1.1 owl:Class"></a>3.2.1.1 owl:Class</h4><p><code>owl:Class</code> 表示一个明明资源是一个类别，比如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ex：Human rdf:type owl:Class .</span><br></pre></td></tr></table></figure>
<p>其中 <code>ex</code> 表示本体的命名空间。下面的例子我们都用 RDF/XML 语法进行举例，所以上面的例子改写成：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&lt;owl:Class rdf:ID=&quot;Human&quot;/&gt;</span><br></pre></td></tr></table></figure>
<div class="container" style="margin-top:40px;margin-bottom:20px;">
    <div style="background-color:#54c7ec;height:36px;line-height:36px;vertical-align:middle;">
        <div style="margin-left:10px">
            <font color="white" size="4">
                • NOTE
            </font>
        </div>
    </div>
    <div style="background-color:#F3F4F7">
        <div style="padding:15px 10px 15px 20px;line-height:1.5;">
            OWL Lite 和 OWL DL 中 <code>owl:Class</code> 必须用在所有的类描述上。
        </div>    
    </div>    
</div>

<div class="container" style="margin-top:40px;margin-bottom:20px;">
    <div style="background-color:#54c7ec;height:36px;line-height:36px;vertical-align:middle;">
        <div style="margin-left:10px">
            <font color="white" size="4">
                • NOTE
            </font>
        </div>
    </div>
    <div style="background-color:#F3F4F7">
        <div style="padding:15px 10px 15px 20px;line-height:1.5;">
            在 OWL Lite 和 OWL DL 中<code>owl:Class</code> 是 <code>rdfs:Class</code> 的子类。这个关系说明
            在 RDFS 中，并不是所有的类在 OWL DL(Lite) 都是合法的。但是在 OWL Full 中二者是等价的。
        </div>    
    </div>    
</div>

<p>OWL 类标识符是预先定义好的，即 <code>owl:Thing</code> / <code>owl:Nothing</code>。<code>owl:Thing</code> 是所有 OWL 类的父类，而 <code>owl:Nothing</code> 是所有类的子类（可以认为就是空集）。</p>
<h4 id="3-2-1-2-owl-oneOf"><a href="#3-2-1-2-owl-oneOf" class="headerlink" title="3.2.1.2 owl:oneOf"></a>3.2.1.2 owl:oneOf</h4><p><code>owl:oneOf</code> 用来表示类描述中的穷举，它的值必须是类的实例。为了方便，我们可以用 <code>rdfs:parseType=&quot;Collection&quot;</code> ，例如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">&lt;owl:Class&gt;</span><br><span class="line">  &lt;owl:oneOf rdf:parseType=&quot;Collection&quot;&gt;</span><br><span class="line">    &lt;owl:Thing rdf:about=&quot;#Eurasia&quot;/&gt;</span><br><span class="line">    &lt;owl:Thing rdf:about=&quot;#Africa&quot;/&gt;</span><br><span class="line">    &lt;owl:Thing rdf:about=&quot;#NorthAmerica&quot;/&gt;</span><br><span class="line">    &lt;owl:Thing rdf:about=&quot;#SouthAmerica&quot;/&gt;</span><br><span class="line">    &lt;owl:Thing rdf:about=&quot;#Australia&quot;/&gt;</span><br><span class="line">    &lt;owl:Thing rdf:about=&quot;#Antarctica&quot;/&gt;</span><br><span class="line">  &lt;/owl:oneOf&gt;</span><br><span class="line">&lt;/owl:Class&gt;</span><br></pre></td></tr></table></figure>
<div class="container" style="margin-top:40px;margin-bottom:20px;">
    <div style="background-color:#54c7ec;height:36px;line-height:36px;vertical-align:middle;">
        <div style="margin-left:10px">
            <font color="white" size="4">
                • NOTE
            </font>
        </div>
    </div>
    <div style="background-color:#F3F4F7">
        <div style="padding:15px 10px 15px 20px;line-height:1.5;">
            OWL Lite 没有穷举。
        </div>    
    </div>    
</div>

<h4 id="3-2-1-3-owl-Restriction"><a href="#3-2-1-3-owl-Restriction" class="headerlink" title="3.2.1.3 owl:Restriction"></a>3.2.1.3 owl:Restriction</h4><p>属性限制是一类特殊的类描述。它用来描述所有个体都满足一定限制条件的匿名类。OWL 有两种属性限制：值限制和基数限制。</p>
<ul>
<li>所谓值限制指的是，限制属性的值域。</li>
<li>所谓基数限制指的是，限制属性的个数。</li>
</ul>
<p>OWL 还提供了全局基数限制：<code>owl:FunctionalProperty</code> 和 <code>owl:InverseFunctionalProperty</code>。</p>
<p><code>owl:Restriction</code> 是 <code>owl:Class</code> 的子类。一个限制类应该有一个三元组用 <code>owl:onProperty</code> 来连接属性和限制。</p>
<ul>
<li><p><strong>值限制</strong></p>
<ol>
<li><p><code>owl:allValuesFrom</code>：用来限制一个类的所有个体是否在指定的值域内。比如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">&lt;owl:Restriction&gt;</span><br><span class="line">  &lt;owl:onProperty rdf:resource=&quot;#hasParent&quot; /&gt;</span><br><span class="line">  &lt;owl:allValuesFrom rdf:resource=&quot;#Human&quot;  /&gt;</span><br><span class="line">&lt;/owl:Restriction&gt;</span><br></pre></td></tr></table></figure>
</li>
<li><p><code>owl:someValuesFrom</code>：用来限制一个类的所有个体中，至少有一个个体来源于指定的值域。比如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">&lt;owl:Restriction&gt;</span><br><span class="line">  &lt;owl:onProperty rdf:resource=&quot;#hasParent&quot; /&gt;</span><br><span class="line">  &lt;owl:someValuesFrom rdf:resource=&quot;#Physician&quot; /&gt;</span><br><span class="line">&lt;/owl:Restriction&gt;</span><br></pre></td></tr></table></figure>
</li>
<li><p><code>owl:hasValue</code>：用来限制一个类的所有个体中，至少有一个（语义上）等于指定的值。比如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">&lt;owl:Restriction&gt;</span><br><span class="line">  &lt;owl:onProperty rdf:resource=&quot;#hasParent&quot; /&gt;</span><br><span class="line">  &lt;owl:hasValue rdf:resource=&quot;#Clinton&quot; /&gt;</span><br><span class="line">&lt;/owl:Restriction&gt;</span><br></pre></td></tr></table></figure>
<div class="container" style="margin-top:40px;margin-bottom:20px;">
    <div style="background-color:#54c7ec;height:36px;line-height:36px;vertical-align:middle;">
        <div style="margin-left:10px">
            <font color="white" size="4">
                • NOTE
            </font>
        </div>
    </div>
    <div style="background-color:#F3F4F7">
        <div style="padding:15px 10px 15px 20px;line-height:1.5;">
            “语义上等价于”的意思是，V 不一定是指定的值，但是 V 和指定的值 V1 之间有一个 <code>owl:sameAs</code>的关系。
        </div>    
    </div>    
</div>
</li>
</ol>
</li>
<li><p><strong>基数限制</strong></p>
<ol>
<li><p><code>owl:maxCardinality</code>：用来限制一个类包含了最多 N 个语义不同的个体，其中 N 就是基数限制的值。比如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">&lt;owl:Restriction&gt;</span><br><span class="line">  &lt;owl:onProperty rdf:resource=&quot;#hasParent&quot; /&gt;</span><br><span class="line">  &lt;owl:maxCardinality rdf:datatype=&quot;&amp;xsd;nonNegativeInteger&quot;&gt;2&lt;/owl:maxCardinality&gt;</span><br><span class="line">&lt;/owl:Restriction&gt;</span><br></pre></td></tr></table></figure>
</li>
<li><p><code>owl:minCardinality</code>：用来限制一个类至少包含 N 个语义不同的个体，其中 N 就是基数限制的值。</p>
<p>比如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">&lt;owl:Restriction&gt;</span><br><span class="line">  &lt;owl:onProperty rdf:resource=&quot;#hasParent&quot; /&gt;</span><br><span class="line">  &lt;owl:minCardinality rdf:datatype=&quot;&amp;xsd;nonNegativeInteger&quot;&gt;2&lt;/owl:minCardinality&gt;</span><br><span class="line">&lt;/owl:Restriction&gt;</span><br></pre></td></tr></table></figure>
<div class="container" style="margin-top:40px;margin-bottom:20px;">
    <div style="background-color:#54c7ec;height:36px;line-height:36px;vertical-align:middle;">
        <div style="margin-left:10px">
            <font color="white" size="4">
                • NOTE
            </font>
        </div>
    </div>
    <div style="background-color:#F3F4F7">
        <div style="padding:15px 10px 15px 20px;line-height:1.5;">
            一个类中的所有实例都要有 N 个属性。
        </div>    
    </div>    
</div>
</li>
<li><p><code>owl:cardinality</code>：用来限制一个类必须要有 N 个语义不同的个体，不能多也不能少。其中 N 就是基数限制的值。比如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">&lt;owl:Restriction&gt;</span><br><span class="line">  &lt;owl:onProperty rdf:resource=&quot;#hasParent&quot; /&gt;</span><br><span class="line">  &lt;owl:cardinality rdf:datatype=&quot;&amp;xsd;nonNegativeInteger&quot;&gt;2&lt;/owl:cardinality&gt;</span><br><span class="line">&lt;/owl:Restriction&gt;</span><br></pre></td></tr></table></figure>
</li>
</ol>
</li>
</ul>
<h4 id="3-2-1-4-Intersection-union-and-complement"><a href="#3-2-1-4-Intersection-union-and-complement" class="headerlink" title="3.2.1.4 Intersection, union and complement"></a>3.2.1.4 Intersection, union and complement</h4><ul>
<li><p><code>owl:intersectionOf</code>：连接一个类和一个类描述的列表，表示这个类的外延中的个体同时也是列表中所有类描述的外延成员。比如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">&lt;owl:Class&gt;</span><br><span class="line">  &lt;owl:intersectionOf rdf:parseType=&quot;Collection&quot;&gt;</span><br><span class="line">    &lt;owl:Class&gt;</span><br><span class="line">      &lt;owl:oneOf rdf:parseType=&quot;Collection&quot;&gt;</span><br><span class="line">        &lt;owl:Thing rdf:about=&quot;#Tosca&quot; /&gt;</span><br><span class="line">        &lt;owl:Thing rdf:about=&quot;#Salome&quot; /&gt;</span><br><span class="line">      &lt;/owl:oneOf&gt;</span><br><span class="line">    &lt;/owl:Class&gt;</span><br><span class="line">    &lt;owl:Class&gt;</span><br><span class="line">      &lt;owl:oneOf rdf:parseType=&quot;Collection&quot;&gt;</span><br><span class="line">        &lt;owl:Thing rdf:about=&quot;#Turandot&quot; /&gt;</span><br><span class="line">        &lt;owl:Thing rdf:about=&quot;#Tosca&quot; /&gt;</span><br><span class="line">      &lt;/owl:oneOf&gt;</span><br><span class="line">    &lt;/owl:Class&gt;</span><br><span class="line">  &lt;/owl:intersectionOf&gt;</span><br><span class="line">&lt;/owl:Class&gt;</span><br></pre></td></tr></table></figure>
<p><code>owl:intersectionOf</code> 可以看成逻辑连词。</p>
</li>
<li><p><code>owl:unionOf</code>：表示一个个体至少会出现在列表中的一个类中。比如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">&lt;owl:Class&gt;</span><br><span class="line">  &lt;owl:unionOf rdf:parseType=&quot;Collection&quot;&gt;</span><br><span class="line">    &lt;owl:Class&gt;</span><br><span class="line">      &lt;owl:oneOf rdf:parseType=&quot;Collection&quot;&gt;</span><br><span class="line">        &lt;owl:Thing rdf:about=&quot;#Tosca&quot; /&gt;</span><br><span class="line">        &lt;owl:Thing rdf:about=&quot;#Salome&quot; /&gt;</span><br><span class="line">      &lt;/owl:oneOf&gt;</span><br><span class="line">    &lt;/owl:Class&gt;</span><br><span class="line">    &lt;owl:Class&gt;</span><br><span class="line">      &lt;owl:oneOf rdf:parseType=&quot;Collection&quot;&gt;</span><br><span class="line">        &lt;owl:Thing rdf:about=&quot;#Turandot&quot; /&gt;</span><br><span class="line">        &lt;owl:Thing rdf:about=&quot;#Tosca&quot; /&gt;</span><br><span class="line">      &lt;/owl:oneOf&gt;</span><br><span class="line">    &lt;/owl:Class&gt;</span><br><span class="line">  &lt;/owl:unionOf&gt;</span><br><span class="line">&lt;/owl:Class&gt;</span><br></pre></td></tr></table></figure>
</li>
<li><p><code>owl:complementOf</code>：连接一个类和一个类描述，表示类外延中的个体不属于类描述的外延。比如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">&lt;owl:Class&gt;</span><br><span class="line">  &lt;owl:complementOf&gt;</span><br><span class="line">    &lt;owl:Class rdf:about=&quot;#Meat&quot;/&gt;</span><br><span class="line">  &lt;/owl:complementOf&gt;</span><br><span class="line">&lt;/owl:Class&gt;</span><br></pre></td></tr></table></figure>
</li>
</ul>
<h3 id="3-2-2-类公理"><a href="#3-2-2-类公理" class="headerlink" title="3.2.2 类公理"></a>3.2.2 类公理</h3><p>类描述通过类公理组合在一起用来定义一个类。这句话说起来很拗口，其实描述的道理很简单。就相当于我们要炒一盘菜，需要一些原材料（类描述），然后通过一些原则（类公理）将这些原料组合在一起形成一盘菜（类）。</p>
<p>OWL 提供了 3 个词汇，将类描述组合起来：</p>
<ul>
<li><code>rdfs:subClassOf</code></li>
<li><code>owl:equivalentClass</code></li>
<li><code>owl:disjointWith</code></li>
</ul>
<h4 id="3-2-2-1-rdfs-subClassOf"><a href="#3-2-2-1-rdfs-subClassOf" class="headerlink" title="3.2.2.1 rdfs:subClassOf"></a>3.2.2.1 rdfs:subClassOf</h4><script type="math/tex; mode=display">
class\ description \quad \text{rdfs:subClassOf} \quad class\ description</script><p>这里的 <code>rdfs:subClassOf</code> 和 RDFS 中的一样。比如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">&lt;owl:Class rdf:ID=&quot;Opera&quot;&gt;</span><br><span class="line">  &lt;rdfs:subClassOf rdf:resource=&quot;#MusicalWork&quot; /&gt;</span><br><span class="line">&lt;/owl:Class&gt;</span><br></pre></td></tr></table></figure>
<h4 id="3-2-2-2-owl-equivalentClass"><a href="#3-2-2-2-owl-equivalentClass" class="headerlink" title="3.2.2.2 owl:equivalentClass"></a>3.2.2.2 owl:equivalentClass</h4><script type="math/tex; mode=display">
class\ description\quad \text{owl:equivalentClass}\quad class\ description</script><p><code>owl:equivalentClass</code> 表示两个类描述有相同的类外延。最简单的形式是，两个命名类别是等价的。比如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">&lt;owl:Class rdf:about=&quot;#US_President&quot;&gt;</span><br><span class="line">  &lt;equivalentClass rdf:resource=&quot;#PrincipalResidentOfWhiteHouse&quot;/&gt;</span><br><span class="line">&lt;/owl:Class&gt;</span><br></pre></td></tr></table></figure>
<div class="container" style="margin-top:40px;margin-bottom:20px;">
    <div style="background-color:#54c7ec;height:36px;line-height:36px;vertical-align:middle;">
        <div style="margin-left:10px">
            <font color="white" size="4">
                • NOTE
            </font>
        </div>
    </div>
    <div style="background-color:#F3F4F7">
        <div style="padding:15px 10px 15px 20px;line-height:1.5;">
            <code>owl:equivalentClass</code> 的两个类并不表示两个类是等价的。
        </div>    
    </div>    
</div>

<p>比如上例中，“美国总统” 这个概念和“白宫的主要居民”这个概念并不一样。真正的语义等价应该用 <code>owl:sameAs</code>。</p>
<h4 id="3-2-2-3-owl-disjointWith"><a href="#3-2-2-3-owl-disjointWith" class="headerlink" title="3.2.2.3 owl:disjointWith"></a>3.2.2.3 owl:disjointWith</h4><script type="math/tex; mode=display">
class\ description\quad \text{owl:disjointWith}\quad class\ description</script><p><code>owl:disjointWith</code> 表示两个类描述没有公共的个体，或者说两个类描述是互斥的。比如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">&lt;owl:Class rdf:about=&quot;#Man&quot;&gt;</span><br><span class="line">  &lt;owl:disjointWith rdf:resource=&quot;#Woman&quot;/&gt;</span><br><span class="line">&lt;/owl:Class&gt;</span><br></pre></td></tr></table></figure>
<h2 id="3-3-Properties"><a href="#3-3-Properties" class="headerlink" title="3.3 Properties"></a>3.3 Properties</h2><p> OWL 有两种属性：对象属性（object property）和数据类型属性（datatype property）。对象属性用来连接两个实例，而数据类型属性连接一个实例和寿哥数据类型的字面量。换成比较容易理解的话就是，对象属性表示两个实体之间的关系，数据类型属性就是实体和属性之间的关系。比如</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">小明 父亲 大明</span><br><span class="line">小明 生日 1990/1/1</span><br></pre></td></tr></table></figure>
<p>其中“父亲”就是对象属性，“生日”就是数据类型属性。</p>
<p>OWL 中支持的属性机构包括：</p>
<ul>
<li>RDFS ：<code>rdfs:subPropertyOf</code>, <code>rdfs:domain</code> 和 <code>rdfs:range</code></li>
<li>与其他属性相关的： <code>owl:equivalentProperty</code> 和 <code>owl:inverseOf</code></li>
<li>全局基数限制：<code>owl:FunctionalProperty</code> 和 <code>owl:InverseFunctionalProperty</code></li>
<li>逻辑属性： <code>owl:SymmetricProperty</code> 和 <code>owl:TransitiveProperty</code></li>
</ul>
<h3 id="3-3-1-owl-equivalentProperty"><a href="#3-3-1-owl-equivalentProperty" class="headerlink" title="3.3.1 owl:equivalentProperty"></a>3.3.1 owl:equivalentProperty</h3><p><code>owl:equivalentProperty</code> 表示两个属性有相同的属性外延。类似 <code>owl:equivalentClass</code>。</p>
<h3 id="3-3-2-owl-inverseOf"><a href="#3-3-2-owl-inverseOf" class="headerlink" title="3.3.2 owl:inverseOf"></a>3.3.2 owl:inverseOf</h3><p>属性是有方向的，从定义域指向值域。<code>owl:inverseOf</code> 表示反向属性，即原属性的定义域和值域互换。比如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">&lt;owl:ObjectProperty rdf:ID=&quot;hasChild&quot;&gt;</span><br><span class="line">  &lt;owl:inverseOf rdf:resource=&quot;#hasParent&quot;/&gt;</span><br><span class="line">&lt;/owl:ObjectProperty&gt;</span><br></pre></td></tr></table></figure>
<h3 id="3-3-3-owl-FunctionalProperty"><a href="#3-3-3-owl-FunctionalProperty" class="headerlink" title="3.3.3 owl:FunctionalProperty"></a>3.3.3 owl:FunctionalProperty</h3><p><code>owl:FunctionalProperty</code> 表示对于实例 $x$ 来说，只有唯一的 $y$ 值。比如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">&lt;owl:ObjectProperty rdf:ID=&quot;husband&quot;&gt;</span><br><span class="line">  &lt;rdfs:domain rdf:resource=&quot;#Woman&quot; /&gt;</span><br><span class="line">  &lt;rdfs:range  rdf:resource=&quot;#Man&quot; /&gt;</span><br><span class="line">&lt;/owl:ObjectProperty&gt;</span><br><span class="line"></span><br><span class="line">&lt;owl:FunctionalProperty rdf:about=&quot;#husband&quot; /&gt;</span><br></pre></td></tr></table></figure>
<h3 id="3-3-4-owl-InverseFunctionalProperty"><a href="#3-3-4-owl-InverseFunctionalProperty" class="headerlink" title="3.3.4 owl:InverseFunctionalProperty"></a>3.3.4 owl:InverseFunctionalProperty</h3><p><code>owl:InverseFunctionalProperty</code> 表示与 <code>owl:FunctionalProperty</code> 相反的意思，即对于值 $y$ 只能有一个 实例 $x$ 与之对应。比如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">&lt;owl:InverseFunctionalProperty rdf:ID=&quot;biologicalMotherOf&quot;&gt;</span><br><span class="line">  &lt;rdfs:domain rdf:resource=&quot;#Woman&quot;/&gt;</span><br><span class="line">  &lt;rdfs:range rdf:resource=&quot;#Human&quot;/&gt;</span><br><span class="line">&lt;/owl:InverseFunctionalProperty&gt;</span><br></pre></td></tr></table></figure>
<h3 id="3-3-5-owl-TransitiveProperty"><a href="#3-3-5-owl-TransitiveProperty" class="headerlink" title="3.3.5 owl:TransitiveProperty"></a>3.3.5 owl:TransitiveProperty</h3><p><code>owl:TransitiveProperty</code> 表示属性的可传递性。如果 $(x,y)$ 是 P 的实例，$(y,z)$ 也是 P 的实例，那么 $(x,z)$ 也是 P 的实例。比如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">&lt;owl:TransitiveProperty rdf:ID=&quot;subRegionOf&quot;&gt;</span><br><span class="line">  &lt;rdfs:domain rdf:resource=&quot;#Region&quot;/&gt;</span><br><span class="line">  &lt;rdfs:range  rdf:resource=&quot;#Region&quot;/&gt;</span><br><span class="line">&lt;/owl:TransitiveProperty&gt;</span><br></pre></td></tr></table></figure>
<h3 id="3-3-6-owl-SymmetricProperty"><a href="#3-3-6-owl-SymmetricProperty" class="headerlink" title="3.3.6 owl:SymmetricProperty"></a>3.3.6 owl:SymmetricProperty</h3><p><code>owl:SymmetricProperty</code> 表示如果 $(x,y)$ 是 P 的实例，那么 $(y,x)$ 也是 P 的实例。比如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">&lt;owl:SymmetricProperty rdf:ID=&quot;friendOf&quot;&gt;</span><br><span class="line">  &lt;rdfs:domain rdf:resource=&quot;#Human&quot;/&gt;</span><br><span class="line">  &lt;rdfs:range  rdf:resource=&quot;#Human&quot;/&gt;</span><br><span class="line">&lt;/owl:SymmetricProperty&gt;</span><br></pre></td></tr></table></figure>
<h2 id="3-4-Individuals"><a href="#3-4-Individuals" class="headerlink" title="3.4 Individuals"></a>3.4 Individuals</h2><p>个体分为两种：</p>
<ol>
<li>类的成员和个体的属性值</li>
<li>个体身份</li>
</ol>
<h3 id="3-4-1-类的成员和个体属性值"><a href="#3-4-1-类的成员和个体属性值" class="headerlink" title="3.4.1 类的成员和个体属性值"></a>3.4.1 类的成员和个体属性值</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">&lt;Opera rdf:ID=&quot;Tosca&quot;&gt;</span><br><span class="line">  &lt;hasComposer rdf:resource=&quot;#Giacomo_Puccini&quot;/&gt;</span><br><span class="line">  &lt;hasLibrettist rdf:resource=&quot;#Victorien_Sardou&quot;/&gt;</span><br><span class="line">  &lt;hasLibrettist rdf:resource=&quot;#Giuseppe_Giacosa&quot;/&gt;</span><br><span class="line">  &lt;hasLibrettist rdf:resource=&quot;#Luigi_Illica&quot;/&gt;</span><br><span class="line">  &lt;premiereDate rdf:datatype=&quot;&amp;xsd;date&quot;&gt;1900-01-14&lt;/premiereDate&gt;</span><br><span class="line">  &lt;premierePlace rdf:resource=&quot;#Roma&quot;/&gt;</span><br><span class="line">  &lt;numberOfActs rdf:datatype=&quot;&amp;xsd;positiveInteger&quot;&gt;3&lt;/numberOfActs&gt; </span><br><span class="line">&lt;/Opera&gt;</span><br></pre></td></tr></table></figure>
<h3 id="3-4-2-个体身份"><a href="#3-4-2-个体身份" class="headerlink" title="3.4.2 个体身份"></a>3.4.2 个体身份</h3><p>通常我们会给不同的事物取不同的名字，但是我们并不能保证不重名。比如“苹果”既可以是电子产品，也可以是水果。为了对个体的身份进行区分或合并，OWL 也设计了一套词汇：</p>
<ul>
<li><code>owl:sameAs</code>：表明是相同的个体，只是名字不同</li>
<li><code>owl:differentFrom</code>：表明是两个不同的个体</li>
<li><code>owl:AllDifferent</code>：表明列表中所有的个体都不相同</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">&lt;rdf:Description rdf:about=&quot;#William_Jefferson_Clinton&quot;&gt;</span><br><span class="line">  &lt;owl:sameAs rdf:resource=&quot;#BillClinton&quot;/&gt;</span><br><span class="line">&lt;/rdf:Description&gt;</span><br></pre></td></tr></table></figure>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">&lt;Opera rdf:ID=&quot;Don_Giovanni&quot;/&gt;</span><br><span class="line"></span><br><span class="line">&lt;Opera rdf:ID=&quot;Nozze_di_Figaro&quot;&gt;</span><br><span class="line">  &lt;owl:differentFrom rdf:resource=&quot;#Don_Giovanni&quot;/&gt;</span><br><span class="line">&lt;/Opera&gt;</span><br><span class="line"></span><br><span class="line">&lt;Opera rdf:ID=&quot;Cosi_fan_tutte&quot;&gt;</span><br><span class="line">  &lt;owl:differentFrom rdf:resource=&quot;#Don_Giovanni&quot;/&gt;</span><br><span class="line">  &lt;owl:differentFrom rdf:resource=&quot;#Nozze_di_Figaro&quot;/&gt;</span><br><span class="line">&lt;/Opera&gt;</span><br></pre></td></tr></table></figure>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">&lt;owl:AllDifferent&gt;</span><br><span class="line">  &lt;owl:distinctMembers rdf:parseType=&quot;Collection&quot;&gt;</span><br><span class="line">    &lt;Opera rdf:about=&quot;#Don_Giovanni&quot;/&gt;</span><br><span class="line">    &lt;Opera rdf:about=&quot;#Nozze_di_Figaro&quot;/&gt;</span><br><span class="line">    &lt;Opera rdf:about=&quot;#Cosi_fan_tutte&quot;/&gt;</span><br><span class="line">    &lt;Opera rdf:about=&quot;#Tosca&quot;/&gt;</span><br><span class="line">    &lt;Opera rdf:about=&quot;#Turandot&quot;/&gt;</span><br><span class="line">    &lt;Opera rdf:about=&quot;#Salome&quot;/&gt;</span><br><span class="line">  &lt;/owl:distinctMembers&gt;</span><br><span class="line">&lt;/owl:AllDifferent&gt;</span><br></pre></td></tr></table></figure>
<h1 id="4-结语"><a href="#4-结语" class="headerlink" title="4. 结语"></a>4. 结语</h1><p>关于 RDFS 和 OWL 的词汇总结我们就介绍这么多。当然，这些都只是一小部分，要想看完整版的推荐看 w3c 的官方文档。我们总结出来的这些词汇是比较常用的，同时也是有助于帮助不了解本体，不了解知识建模的同学对这些东西有一个大体的概念。其实本体建模就是在构建一套逻辑体系，这套逻辑体系帮助计算机进行逻辑推理。而无论是 RDFS 还是 OWL 亦或是其他众多我们没有介绍的词汇表都是在尝试将这样一个逻辑体系进行标准化。先阶段计算机的逻辑推理能力仍然处于很弱的阶段，说明我们现在的工作仍然很初级。我们这里总结的相关内容也许在不久的将来就会过期，失效甚至被推翻。但是了解这些知识也有助于我们对未来的发展有一个清晰的认知。</p>
<h1 id="Reference"><a href="#Reference" class="headerlink" title="Reference"></a>Reference</h1><ol>
<li><a href="https://www.w3.org/TR/rdf-schema/" target="_blank" rel="noopener">RDF Schema 1.1</a></li>
<li><a href="https://www.w3.org/TR/2004/REC-owl-ref-20040210/" target="_blank" rel="noopener">OWL Web Ontology Language</a> </li>
<li><a href="https://fusion.cs.uni-jena.de/fusion/blog/2016/11/18/iri-uri-url-urn-and-their-differences/" target="_blank" rel="noopener">IRI, URI, URL, URN and their differences</a>, <em>JAN MARTIN KEIL</em> </li>
<li><a href="https://zhangzifan.com/t/7393.html" target="_blank" rel="noopener">浅谈什么是 URL、URI、IRI、URN 及之间的区别</a>, <em>张子凡</em> </li>
<li>语义网技术体系 [瞿裕忠，胡伟，程龚 编著] 2015年版</li>
<li><a href="https://www.jianshu.com/p/9e2bfa9a5a06" target="_blank" rel="noopener">知识图谱-浅谈RDF、OWL、SPARQL</a>, <em>吕不韦</em> </li>
</ol>

        </div>
        
          


  <section class='meta' id="footer-meta">
    <hr>
    <div class='new-meta-box'>
      
        
          <div class="new-meta-item date" itemprop="dateUpdated" datetime="2021-08-31T23:33:24+08:00">
  <a class='notlink'>
    <i class="fas fa-clock" aria-hidden="true"></i>
    <p>最后更新于 2021年8月31日</p>
  </a>
</div>

        
      
        
          
  
  <div class="new-meta-item meta-tags"><a class="tag" href="/tags/kg/" rel="nofollow"><i class="fas fa-hashtag" aria-hidden="true"></i>&nbsp;<p>KG</p></a></div> <div class="new-meta-item meta-tags"><a class="tag" href="/tags/knowledge-modelling/" rel="nofollow"><i class="fas fa-hashtag" aria-hidden="true"></i>&nbsp;<p>knowledge-modelling</p></a></div>


        
      
        
          
  <div class="new-meta-item share -mob-share-list">
  <div class="-mob-share-list share-body">
    
      
        <a class="-mob-share-qq" title="QQ好友" rel="external nofollow noopener noreferrer"
          
          href="http://connect.qq.com/widget/shareqq/index.html?url=https://rogerspy.gitee.io/2021/08/26/kg-rdf-vocabulary/&title=知识图谱：知识建模（三）RDFS/OWL 词汇表 | Rogerspy's Home&summary=
前面的文章介绍了知识建模，我们提到知识建模使用的是 RDF 知识表示法，而 RDFS 本质上是一个标准化语义词汇表。所以本文总结一些常用的 RDFS/OWL 的语义词汇。"
          
          >
          
            <img src="https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/qq.png">
          
        </a>
      
    
      
        <a class="-mob-share-qzone" title="QQ空间" rel="external nofollow noopener noreferrer"
          
          href="https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=https://rogerspy.gitee.io/2021/08/26/kg-rdf-vocabulary/&title=知识图谱：知识建模（三）RDFS/OWL 词汇表 | Rogerspy's Home&summary=
前面的文章介绍了知识建模，我们提到知识建模使用的是 RDF 知识表示法，而 RDFS 本质上是一个标准化语义词汇表。所以本文总结一些常用的 RDFS/OWL 的语义词汇。"
          
          >
          
            <img src="https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/qzone.png">
          
        </a>
      
    
      
        <a class='qrcode' rel="external nofollow noopener noreferrer" href=''>
        
          <img src="https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/wechat.png">
        
        </a>
      
    
      
        <a class="-mob-share-weibo" title="微博" rel="external nofollow noopener noreferrer"
          
          href="http://service.weibo.com/share/share.php?url=https://rogerspy.gitee.io/2021/08/26/kg-rdf-vocabulary/&title=知识图谱：知识建模（三）RDFS/OWL 词汇表 | Rogerspy's Home&summary=
前面的文章介绍了知识建模，我们提到知识建模使用的是 RDF 知识表示法，而 RDFS 本质上是一个标准化语义词汇表。所以本文总结一些常用的 RDFS/OWL 的语义词汇。"
          
          >
          
            <img src="https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/weibo.png">
          
        </a>
      
    
  </div>
</div>



        
      
    </div>
  </section>


        
        
            <div class="prev-next">
                
                    <section class="prev">
                        <span class="art-item-left">
                            <h6><i class="fas fa-chevron-left" aria-hidden="true"></i>&nbsp;上一页</h6>
                            <h4>
                                <a href="/2021/09/04/ds-stack/" rel="prev" title="数据结构与算法：栈（stack）">
                                  
                                      数据结构与算法：栈（stack）
                                  
                                </a>
                            </h4>
                            
                                
                                <h6 class="tags">
                                    <a class="tag" href="/tags/数据结构/"><i class="fas fa-hashtag fa-fw" aria-hidden="true"></i>数据结构</a> <a class="tag" href="/tags/stack/"><i class="fas fa-hashtag fa-fw" aria-hidden="true"></i>stack</a>
                                </h6>
                            
                        </span>
                    </section>
                
                
                    <section class="next">
                        <span class="art-item-right" aria-hidden="true">
                            <h6>下一页&nbsp;<i class="fas fa-chevron-right" aria-hidden="true"></i></h6>
                            <h4>
                                <a href="/2021/08/23/kg-build-ontology-method/" rel="prev" title="知识图谱：知识建模（二）构建本体的方法论">
                                    
                                        知识图谱：知识建模（二）构建本体的方法论
                                    
                                </a>
                            </h4>
                            
                                
                                <h6 class="tags">
                                    <a class="tag" href="/tags/ontology/"><i class="fas fa-hashtag fa-fw" aria-hidden="true"></i>ontology</a> <a class="tag" href="/tags/kg/"><i class="fas fa-hashtag fa-fw" aria-hidden="true"></i>KG</a>
                                </h6>
                            
                        </span>
                    </section>
                
            </div>
        
      </section>
    </article>
  

  
    <!-- 显示推荐文章和评论 -->



  <article class="post white-box comments">
    <section class="article typo">
      <h4><i class="fas fa-comments fa-fw" aria-hidden="true"></i>&nbsp;评论</h4>
      
      
      
        <section id="comments">
          <div id="gitalk-container"></div>
        </section>
      
      
    </section>
  </article>


  




<!-- 根据页面mathjax变量决定是否加载MathJax数学公式js -->

  <!-- MathJax配置，可通过单美元符号书写行内公式等 -->
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    "HTML-CSS": {
      preferredFont: "TeX",
      availableFonts: ["STIX","TeX"],
      linebreaks: { automatic:true },
      EqnChunk: (MathJax.Hub.Browser.isMobile ? 10 : 50)
    },
    tex2jax: {
      inlineMath: [ ["$", "$"], ["\\(","\\)"] ],
      processEscapes: true,
      ignoreClass: "tex2jax_ignore|dno",
      skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
    },
    TeX: {
      equationNumbers: { autoNumber: "AMS" },
      noUndefined: { attributes: { mathcolor: "red", mathbackground: "#FFEEEE", mathsize: "90%" } },
      Macros: { href: "{}" }
    },
    messageStyle: "none"
  });
</script>
<!-- 给MathJax元素添加has-jax class -->
<script type="text/x-mathjax-config">
  MathJax.Hub.Queue(function() {
    var all = MathJax.Hub.getAllJax(), i;
    for(i=0; i < all.length; i += 1) {
      all[i].SourceElement().parentNode.className += (all[i].SourceElement().parentNode.className ? ' ' : '') + 'has-jax';
    }
  });
</script>
<!-- 通过连接CDN加载MathJax的js代码 -->
<script type="text/javascript" async
  src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML">
</script>




  <script>
    window.subData = {
      title: '知识图谱：知识建模（三）RDFS/OWL 词汇表',
      tools: true
    }
  </script>


</div>
<aside class='l_side'>
  
    
    
      
        
          
          
            <section class='widget shake author'>
  <div class='content pure'>
    
      <div class='avatar'>
        <img class='avatar' src='https://cdn.jsdelivr.net/gh/rogerspy/blog-imgs/65-1Z31313530JC.jpeg'/>
      </div>
    
    
    
      <div class="social-wrapper">
        
          
            <a href="/atom.xml"
              class="social fas fa-rss flat-btn"
              target="_blank"
              rel="external nofollow noopener noreferrer">
            </a>
          
        
          
            <a href="mailto:rogerspy@163.com"
              class="social fas fa-envelope flat-btn"
              target="_blank"
              rel="external nofollow noopener noreferrer">
            </a>
          
        
          
            <a href="https://github.com/rogerspy"
              class="social fab fa-github flat-btn"
              target="_blank"
              rel="external nofollow noopener noreferrer">
            </a>
          
        
          
            <a href="https://music.163.com/#/user/home?id=1960721923"
              class="social fas fa-headphones-alt flat-btn"
              target="_blank"
              rel="external nofollow noopener noreferrer">
            </a>
          
        
      </div>
    
  </div>
</section>

          
        
      
        
          
          
            
  <section class='widget toc-wrapper'>
    
<header class='pure'>
  <div><i class="fas fa-list fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;本文目录</div>
  
    <div class='wrapper'><a class="s-toc rightBtn" rel="external nofollow noopener noreferrer" href="javascript:void(0)"><i class="fas fa-thumbtack fa-fw"></i></a></div>
  
</header>

    <div class='content pure'>
      <ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#0-絮絮叨叨"><span class="toc-text">0. 絮絮叨叨</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#0-1-RDF-XML"><span class="toc-text">0.1 RDF/XML</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#0-2-IRI-URI-URL-URN-的区别"><span class="toc-text">0.2 IRI, URI, URL, URN 的区别</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#1-序言"><span class="toc-text">1. 序言</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#2-RDFS"><span class="toc-text">2. RDFS</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#2-1-Classes"><span class="toc-text">2.1 Classes</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#2-1-1-rdf-Resource"><span class="toc-text">2.1.1 rdf:Resource</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-1-2-rdf-Class"><span class="toc-text">2.1.2 rdf:Class</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-1-3-rdf-Literal"><span class="toc-text">2.1.3 rdf:Literal</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-1-4-rdfs-Property"><span class="toc-text">2.1.4 rdfs:Property</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-2-Properties"><span class="toc-text">2.2.  Properties</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-2-1-rdfs-range"><span class="toc-text">2.2.1 rdfs:range</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#2-2-2-rdfs-domain"><span class="toc-text">2.2.2 rdfs:domain</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-2-3-rdf-type"><span class="toc-text">2.2.3 rdf:type</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-2-4-rdfs-subClassOf"><span class="toc-text">2.2.4 rdfs:subClassOf</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-2-5-rdfs-subPropertyOf"><span class="toc-text">2.2.5 rdfs:subPropertyOf</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-2-6-RDFS-词汇总结"><span class="toc-text">2.2.6 RDFS 词汇总结</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#2-2-6-1-Classes"><span class="toc-text">2.2.6.1 Classes</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#2-2-6-2-Properties"><span class="toc-text">2.2.6.2 Properties</span></a></li></ol></li></ol></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#3-OWL"><span class="toc-text">3. OWL</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#3-1-OWL-Document"><span class="toc-text">3.1 OWL Document</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#3-1-1-owl-imports"><span class="toc-text">3.1.1 owl:imports</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#3-2-OWL-Classes"><span class="toc-text">3.2 OWL Classes</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#3-2-1-类描述（class-description）"><span class="toc-text">3.2.1 类描述（class description）</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#3-2-1-1-owl-Class"><span class="toc-text">3.2.1.1 owl:Class</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#3-2-1-2-owl-oneOf"><span class="toc-text">3.2.1.2 owl:oneOf</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#3-2-1-3-owl-Restriction"><span class="toc-text">3.2.1.3 owl:Restriction</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#3-2-1-4-Intersection-union-and-complement"><span class="toc-text">3.2.1.4 Intersection, union and complement</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3-2-2-类公理"><span class="toc-text">3.2.2 类公理</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#3-2-2-1-rdfs-subClassOf"><span class="toc-text">3.2.2.1 rdfs:subClassOf</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#3-2-2-2-owl-equivalentClass"><span class="toc-text">3.2.2.2 owl:equivalentClass</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#3-2-2-3-owl-disjointWith"><span class="toc-text">3.2.2.3 owl:disjointWith</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#3-3-Properties"><span class="toc-text">3.3 Properties</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#3-3-1-owl-equivalentProperty"><span class="toc-text">3.3.1 owl:equivalentProperty</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3-3-2-owl-inverseOf"><span class="toc-text">3.3.2 owl:inverseOf</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3-3-3-owl-FunctionalProperty"><span class="toc-text">3.3.3 owl:FunctionalProperty</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3-3-4-owl-InverseFunctionalProperty"><span class="toc-text">3.3.4 owl:InverseFunctionalProperty</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3-3-5-owl-TransitiveProperty"><span class="toc-text">3.3.5 owl:TransitiveProperty</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3-3-6-owl-SymmetricProperty"><span class="toc-text">3.3.6 owl:SymmetricProperty</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#3-4-Individuals"><span class="toc-text">3.4 Individuals</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#3-4-1-类的成员和个体属性值"><span class="toc-text">3.4.1 类的成员和个体属性值</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3-4-2-个体身份"><span class="toc-text">3.4.2 个体身份</span></a></li></ol></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#4-结语"><span class="toc-text">4. 结语</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#Reference"><span class="toc-text">Reference</span></a></li></ol>
    </div>
  </section>


          
        
      
        
          
          
            <section class='widget grid'>
  
<header class='pure'>
  <div><i class="fas fa-map-signs fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;站内导航</div>
  
</header>

  <div class='content pure'>
    <ul class="grid navgation">
      
        <li><a class="flat-box" " href="/"
          
          
          id="home">
          
            <i class="fas fa-clock fa-fw" aria-hidden="true"></i>
          
          近期文章
        </a></li>
      
        <li><a class="flat-box" " href="/blog/"
          
          
          id="blog">
          
            <i class="fas fa-edit fa-fw" aria-hidden="true"></i>
          
          我的博客
        </a></li>
      
        <li><a class="flat-box" " href="/paper_note/"
          
          
          id="paper_note">
          
            <i class="fas fa-book fa-fw" aria-hidden="true"></i>
          
          论文笔记
        </a></li>
      
        <li><a class="flat-box" " href="/algorithm/"
          
          
          id="algorithm">
          
            <i class="fas fa-cube fa-fw" aria-hidden="true"></i>
          
          算法基础
        </a></li>
      
        <li><a class="flat-box" " href="/leetcode/"
          
          
          id="leetcode">
          
            <i class="fas fa-code fa-fw" aria-hidden="true"></i>
          
          Leetcode
        </a></li>
      
        <li><a class="flat-box" " href="/video/"
          
          
          id="video">
          
            <i class="fas fa-film fa-fw" aria-hidden="true"></i>
          
          视频小站
        </a></li>
      
        <li><a class="flat-box" " href="/material/"
          
          
          id="material">
          
            <i class="fas fa-briefcase fa-fw" aria-hidden="true"></i>
          
          学习资料
        </a></li>
      
        <li><a class="flat-box" " href="/dataset/"
          
          
          id="dataset">
          
            <i class="fas fa-database fa-fw" aria-hidden="true"></i>
          
          数据集
        </a></li>
      
        <li><a class="flat-box" " href="/articles/"
          
          
          id="articles">
          
            <i class="fas fa-sticky-note fa-fw" aria-hidden="true"></i>
          
          杂文天地
        </a></li>
      
        <li><a class="flat-box" " href="/blog/archives/"
          
            rel="nofollow"
          
          
          id="blogarchives">
          
            <i class="fas fa-archive fa-fw" aria-hidden="true"></i>
          
          文章归档
        </a></li>
      
        <li><a class="flat-box" " href="/personal_center/"
          
          
          id="personal_center">
          
            <i class="fas fa-university fa-fw" aria-hidden="true"></i>
          
          个人中心
        </a></li>
      
        <li><a class="flat-box" " href="/about/"
          
            rel="nofollow"
          
          
          id="about">
          
            <i class="fas fa-info-circle fa-fw" aria-hidden="true"></i>
          
          关于小站
        </a></li>
      
    </ul>
  </div>
</section>

          
        
      
        
          
          
            <section class='widget list'>
  
<header class='pure'>
  <div><i class="fas fa-terminal fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;机器学习框架</div>
  
</header>

  <div class='content pure'>
    <ul class="entry">
      
        <li><a class="flat-box" title="https://rogerspy.gitee.io/pytorch-zh/" href="https://rogerspy.gitee.io/pytorch-zh/"
          
          
          >
          <div class='name'>
            
              <i class="fas fa-star fa-fw" aria-hidden="true"></i>
            
            &nbsp;&nbsp;PyTorch 中文文档
          </div>
          
        </a></li>
      
        <li><a class="flat-box" title="https://keras-zh.readthedocs.io/" href="https://keras-zh.readthedocs.io/"
          
          
          >
          <div class='name'>
            
              <i class="fas fa-star fa-fw" aria-hidden="true"></i>
            
            &nbsp;&nbsp;Keras 中文文档
          </div>
          
        </a></li>
      
        <li><a class="flat-box" title="https://tensorflow.google.cn/" href="https://tensorflow.google.cn/"
          
          
          >
          <div class='name'>
            
              <i class="fas fa-star fa-fw" aria-hidden="true"></i>
            
            &nbsp;&nbsp;Tensorflow 中文文档
          </div>
          
        </a></li>
      
        <li><a class="flat-box" title="http://scikitlearn.com.cn/" href="http://scikitlearn.com.cn/"
          
          
          >
          <div class='name'>
            
              <i class="fas fa-star fa-fw" aria-hidden="true"></i>
            
            &nbsp;&nbsp;Scikit Learn 中文文档
          </div>
          
        </a></li>
      
    </ul>
  </div>
</section>

          
        
      
        
          
          
            <section class='widget list'>
  
<header class='pure'>
  <div><i class="fas fa-wrench fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;百宝箱</div>
  
</header>

  <div class='content pure'>
    <ul class="entry">
      
        <li><a class="flat-box" title="https://rogerspy.github.io/excalidraw-claymate/" href="https://rogerspy.github.io/excalidraw-claymate/"
          
          
            target="_blank"
          
          >
          <div class='name'>
            
              <i class="fas fa-magic fa-fw" aria-hidden="true"></i>
            
            &nbsp;&nbsp;Excalidraw-Claymate
          </div>
          
        </a></li>
      
        <li><a class="flat-box" title="https://rogerspy.github.io/jupyterlite/" href="https://rogerspy.github.io/jupyterlite/"
          
          
            target="_blank"
          
          >
          <div class='name'>
            
              <i class="fas fa-terminal fa-fw" aria-hidden="true"></i>
            
            &nbsp;&nbsp;JupyterLite
          </div>
          
        </a></li>
      
    </ul>
  </div>
</section>

          
        
      
        
          
          
            <section class='widget list'>
  
<header class='pure'>
  <div><i class="fas fa-eye fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;睁眼看世界</div>
  
</header>

  <div class='content pure'>
    <ul class="entry">
      
        <li><a class="flat-box" title="https://deeplearn.org/" href="https://deeplearn.org/"
          
          
          >
          <div class='name'>
            
              <i class="fas fa-link fa-fw" aria-hidden="true"></i>
            
            &nbsp;&nbsp;Deep Learning Monitor
          </div>
          
        </a></li>
      
        <li><a class="flat-box" title="https://paperswithcode.com/sota" href="https://paperswithcode.com/sota"
          
          
          >
          <div class='name'>
            
              <i class="fas fa-link fa-fw" aria-hidden="true"></i>
            
            &nbsp;&nbsp;Browse State-of-the-Art
          </div>
          
        </a></li>
      
        <li><a class="flat-box" title="https://huggingface.co/transformers/" href="https://huggingface.co/transformers/"
          
          
          >
          <div class='name'>
            
              <i class="fas fa-link fa-fw" aria-hidden="true"></i>
            
            &nbsp;&nbsp;Transformers
          </div>
          
        </a></li>
      
        <li><a class="flat-box" title="https://huggingface.co/models" href="https://huggingface.co/models"
          
          
          >
          <div class='name'>
            
              <i class="fas fa-link fa-fw" aria-hidden="true"></i>
            
            &nbsp;&nbsp;Transformers-models
          </div>
          
        </a></li>
      
    </ul>
  </div>
</section>

          
        
      
        
          
          
            
  <section class='widget category'>
    
<header class='pure'>
  <div><i class="fas fa-folder-open fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;文章分类</div>
  
    <a class="rightBtn"
    
      rel="nofollow"
    
    
    href="/categories/"
    title="categories/">
    <i class="fas fa-expand-arrows-alt fa-fw"></i></a>
  
</header>

    <div class='content pure'>
      <ul class="entry">
        
          <li><a class="flat-box" title="/categories/nl2sql/" href="/categories/nl2sql/"><div class='name'>NL2SQL</div><div class='badge'>(1)</div></a></li>
        
          <li><a class="flat-box" title="/categories/nlp/" href="/categories/nlp/"><div class='name'>NLP</div><div class='badge'>(23)</div></a></li>
        
          <li><a class="flat-box" title="/categories/博客转载/" href="/categories/博客转载/"><div class='name'>博客转载</div><div class='badge'>(5)</div></a></li>
        
          <li><a class="flat-box" title="/categories/数据结构与算法/" href="/categories/数据结构与算法/"><div class='name'>数据结构与算法</div><div class='badge'>(11)</div></a></li>
        
          <li><a class="flat-box" title="/categories/知识图谱/" href="/categories/知识图谱/"><div class='name'>知识图谱</div><div class='badge'>(3)</div></a></li>
        
          <li><a class="flat-box" title="/categories/论文解读/" href="/categories/论文解读/"><div class='name'>论文解读</div><div class='badge'>(2)</div></a></li>
        
          <li><a class="flat-box" title="/categories/语言模型/" href="/categories/语言模型/"><div class='name'>语言模型</div><div class='badge'>(10)</div></a></li>
        
      </ul>
    </div>
  </section>


          
        
      
        
          
          
            
  <section class='widget tagcloud'>
    
<header class='pure'>
  <div><i class="fas fa-fire fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;热门标签</div>
  
    <a class="rightBtn"
    
      rel="nofollow"
    
    
    href="/tags/"
    title="tags/">
    <i class="fas fa-expand-arrows-alt fa-fw"></i></a>
  
</header>

    <div class='content pure'>
      <a href="/tags/attention/" style="font-size: 16.86px; color: #868686">Attention</a> <a href="/tags/cnnlm/" style="font-size: 14px; color: #999">CNNLM</a> <a href="/tags/data-structure/" style="font-size: 14px; color: #999">Data Structure</a> <a href="/tags/deep/" style="font-size: 14px; color: #999">Deep</a> <a href="/tags/ffnnlm/" style="font-size: 14px; color: #999">FFNNLM</a> <a href="/tags/gaussian/" style="font-size: 14px; color: #999">Gaussian</a> <a href="/tags/initialization/" style="font-size: 14px; color: #999">Initialization</a> <a href="/tags/kg/" style="font-size: 16.86px; color: #868686">KG</a> <a href="/tags/lstm/" style="font-size: 14px; color: #999">LSTM</a> <a href="/tags/lstmlm/" style="font-size: 14px; color: #999">LSTMLM</a> <a href="/tags/language-model/" style="font-size: 16.86px; color: #868686">Language Model</a> <a href="/tags/log-linear-language-model/" style="font-size: 14px; color: #999">Log-Linear Language Model</a> <a href="/tags/nlp/" style="font-size: 19.71px; color: #727272">NLP</a> <a href="/tags/nmt/" style="font-size: 22.57px; color: #5f5f5f">NMT</a> <a href="/tags/norm/" style="font-size: 14px; color: #999">Norm</a> <a href="/tags/probabilistic-language-model/" style="font-size: 14px; color: #999">Probabilistic Language Model</a> <a href="/tags/rnnlm/" style="font-size: 14px; color: #999">RNNLM</a> <a href="/tags/roc-auc/" style="font-size: 14px; color: #999">ROC-AUC</a> <a href="/tags/transformer/" style="font-size: 24px; color: #555">Transformer</a> <a href="/tags/context2vec/" style="font-size: 14px; color: #999">context2vec</a> <a href="/tags/divide-conquer/" style="font-size: 14px; color: #999">divide-conquer</a> <a href="/tags/insertion/" style="font-size: 16.86px; color: #868686">insertion</a> <a href="/tags/insertion-deletion/" style="font-size: 15.43px; color: #8f8f8f">insertion-deletion</a> <a href="/tags/knowledge-modelling/" style="font-size: 15.43px; color: #8f8f8f">knowledge-modelling</a> <a href="/tags/nl2infographic/" style="font-size: 14px; color: #999">nl2infographic</a> <a href="/tags/nl2sql/" style="font-size: 14px; color: #999">nl2sql</a> <a href="/tags/ontology/" style="font-size: 14px; color: #999">ontology</a> <a href="/tags/parallel-recurrent/" style="font-size: 14px; color: #999">parallel-recurrent</a> <a href="/tags/pytorch/" style="font-size: 14px; color: #999">pytorch</a> <a href="/tags/queue/" style="font-size: 18.29px; color: #7c7c7c">queue</a> <a href="/tags/sparse/" style="font-size: 14px; color: #999">sparse</a> <a href="/tags/stack/" style="font-size: 14px; color: #999">stack</a> <a href="/tags/tensorflow/" style="font-size: 14px; color: #999">tensorflow</a> <a href="/tags/text2viz/" style="font-size: 14px; color: #999">text2viz</a> <a href="/tags/weighted-head/" style="font-size: 14px; color: #999">weighted-head</a> <a href="/tags/半监督语言模型/" style="font-size: 14px; color: #999">半监督语言模型</a> <a href="/tags/双数组前缀树/" style="font-size: 14px; color: #999">双数组前缀树</a> <a href="/tags/推荐系统/" style="font-size: 14px; color: #999">推荐系统</a> <a href="/tags/数据结构/" style="font-size: 21.14px; color: #686868">数据结构</a> <a href="/tags/数组/" style="font-size: 14px; color: #999">数组</a> <a href="/tags/时间复杂度/" style="font-size: 14px; color: #999">时间复杂度</a> <a href="/tags/算法/" style="font-size: 14px; color: #999">算法</a> <a href="/tags/评估方法/" style="font-size: 14px; color: #999">评估方法</a> <a href="/tags/词向量/" style="font-size: 14px; color: #999">词向量</a> <a href="/tags/隐式正则化/" style="font-size: 14px; color: #999">隐式正则化</a>
    </div>
  </section>


          
        
      
        
          
          
            


  <section class='widget music'>
    
<header class='pure'>
  <div><i class="fas fa-compact-disc fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;最近在听</div>
  
    <a class="rightBtn"
    
      rel="external nofollow noopener noreferrer"
    
    
      target="_blank"
    
    href="https://music.163.com/#/user/home?id=1960721923"
    title="https://music.163.com/#/user/home?id=1960721923">
    <i class="far fa-heart fa-fw"></i></a>
  
</header>

    <div class='content pure'>
      
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer@1.7.0/dist/APlayer.min.css">
  <div class="aplayer"
    data-theme="#1BCDFC"
    
    
    data-mode="circulation"
    data-server="netease"
    data-type="playlist"
    data-id="2957571193"
    data-volume="0.7">
  </div>
  <script src="https://cdn.jsdelivr.net/npm/aplayer@1.7.0/dist/APlayer.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/meting@1.1.0/dist/Meting.min.js"></script>


    </div>
  </section>


          
        
      
    

  
</aside>

<footer id="footer" class="clearfix">
  <div id="sitetime"></div>
  
  
    <div class="social-wrapper">
      
        
          <a href="/atom.xml"
            class="social fas fa-rss flat-btn"
            target="_blank"
            rel="external nofollow noopener noreferrer">
          </a>
        
      
        
          <a href="mailto:rogerspy@163.com"
            class="social fas fa-envelope flat-btn"
            target="_blank"
            rel="external nofollow noopener noreferrer">
          </a>
        
      
        
          <a href="https://github.com/rogerspy"
            class="social fab fa-github flat-btn"
            target="_blank"
            rel="external nofollow noopener noreferrer">
          </a>
        
      
        
          <a href="https://music.163.com/#/user/home?id=1960721923"
            class="social fas fa-headphones-alt flat-btn"
            target="_blank"
            rel="external nofollow noopener noreferrer">
          </a>
        
      
    </div>
  
  <br>
  <div><p>博客内容遵循 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0) 协议</a></p>
</div>
  <div>
    本站使用
    <a href="https://xaoxuu.com/wiki/material-x/" target="_blank" class="codename">Material X</a>
    作为主题
    
      ，
      总访问量为
      <span id="busuanzi_value_site_pv"><i class="fas fa-spinner fa-spin fa-fw" aria-hidden="true"></i></span>
      次
    
    。
  </div>
	</footer>

<script>setLoadingBarProgress(80);</script>
<!-- 点击特效，输入特效 运行时间 -->
<script type="text/javascript" src="/cool/cooltext.js"></script>
<script type="text/javascript" src="/cool/clicklove.js"></script>
<script type="text/javascript" src="/cool/sitetime.js"></script>



      <script>setLoadingBarProgress(60);</script>
    </div>
    <a class="s-top fas fa-arrow-up fa-fw" href='javascript:void(0)'></a>
  </div>
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>

  <script>
    var GOOGLE_CUSTOM_SEARCH_API_KEY = "";
    var GOOGLE_CUSTOM_SEARCH_ENGINE_ID = "";
    var ALGOLIA_API_KEY = "";
    var ALGOLIA_APP_ID = "";
    var ALGOLIA_INDEX_NAME = "";
    var AZURE_SERVICE_NAME = "";
    var AZURE_INDEX_NAME = "";
    var AZURE_QUERY_KEY = "";
    var BAIDU_API_ID = "";
    var SEARCH_SERVICE = "hexo" || "hexo";
    var ROOT = "/"||"/";
    if(!ROOT.endsWith('/'))ROOT += '/';
  </script>

<script src="//instant.page/1.2.2" type="module" integrity="sha384-2xV8M5griQmzyiY3CDqh1dn4z3llDVqZDqzjzcY+jCBCk/a5fXJmuZ/40JJAPeoU"></script>


  <script async src="https://cdn.jsdelivr.net/npm/scrollreveal@4.0.5/dist/scrollreveal.min.js"></script>
  <script type="text/javascript">
    $(function() {
      const $reveal = $('.reveal');
      if ($reveal.length === 0) return;
      const sr = ScrollReveal({ distance: 0 });
      sr.reveal('.reveal');
    });
  </script>


  <script src="https://cdn.jsdelivr.net/npm/node-waves@0.7.6/dist/waves.min.js"></script>
  <script type="text/javascript">
    $(function() {
      Waves.attach('.flat-btn', ['waves-button']);
      Waves.attach('.float-btn', ['waves-button', 'waves-float']);
      Waves.attach('.float-btn-light', ['waves-button', 'waves-float', 'waves-light']);
      Waves.attach('.flat-box', ['waves-block']);
      Waves.attach('.float-box', ['waves-block', 'waves-float']);
      Waves.attach('.waves-image');
      Waves.init();
    });
  </script>


  <script async src="https://cdn.jsdelivr.net/gh/xaoxuu/cdn-busuanzi@2.3/js/busuanzi.pure.mini.js"></script>




  
  
  
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-backstretch/2.0.4/jquery.backstretch.min.js"></script>
    <script type="text/javascript">
      $(function(){
        if ('.cover') {
          $('.cover').backstretch(
          ["https://cdn.jsdelivr.net/gh/rogerspy/blog-imgs/a0c9e6f9efad8b731cb7376504bd10d79d2053.jpg"],
          {
            duration: "6000",
            fade: "2500"
          });
        } else {
          $.backstretch(
          ["https://cdn.jsdelivr.net/gh/rogerspy/blog-imgs/a0c9e6f9efad8b731cb7376504bd10d79d2053.jpg"],
          {
            duration: "6000",
            fade: "2500"
          });
        }
      });
    </script>
  







  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css">
  <script src="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js"></script>
  <script type="text/javascript">
    var gitalk = new Gitalk({
      clientID: "35a5e4dc744cc7d162af",
      clientSecret: "7b5a409e17ce0c1971f284eac9f8902eb4b8feba",
      repo: "rogerspy.github.io",
      owner: "Rogerspy",
      admin: "Rogerspy",
      
        id: "/wiki/material-x/",
      
      distractionFreeMode: false  // Facebook-like distraction free mode
    });
    gitalk.render('gitalk-container');
  </script>





  <script src="https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.5/js/app.js"></script>


  <script src="https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.5/js/search.js"></script>




<!-- 复制 -->
<script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script>
<script>
  let COPY_SUCCESS = "复制成功";
  let COPY_FAILURE = "复制失败";
  /*页面载入完成后，创建复制按钮*/
  !function (e, t, a) {
    /* code */
    var initCopyCode = function(){
      var copyHtml = '';
      copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
      copyHtml += '  <i class="fa fa-copy"></i><span>复制</span>';
      copyHtml += '</button>';
      $(".highlight .code pre").before(copyHtml);
      var clipboard = new ClipboardJS('.btn-copy', {
        target: function(trigger) {
          return trigger.nextElementSibling;
        }
      });

      clipboard.on('success', function(e) {
        //您可以加入成功提示
        console.info('Action:', e.action);
        console.info('Text:', e.text);
        console.info('Trigger:', e.trigger);
        success_prompt(COPY_SUCCESS);
        e.clearSelection();
      });
      clipboard.on('error', function(e) {
        //您可以加入失败提示
        console.error('Action:', e.action);
        console.error('Trigger:', e.trigger);
        fail_prompt(COPY_FAILURE);
      });
    }
    initCopyCode();

  }(window, document);

  /**
   * 弹出式提示框，默认1.5秒自动消失
   * @param message 提示信息
   * @param style 提示样式，有alert-success、alert-danger、alert-warning、alert-info
   * @param time 消失时间
   */
  var prompt = function (message, style, time)
  {
      style = (style === undefined) ? 'alert-success' : style;
      time = (time === undefined) ? 1500 : time*1000;
      $('<div>')
          .appendTo('body')
          .addClass('alert ' + style)
          .html(message)
          .show()
          .delay(time)
          .fadeOut();
  };

  // 成功提示
  var success_prompt = function(message, time)
  {
      prompt(message, 'alert-success', time);
  };

  // 失败提示
  var fail_prompt = function(message, time)
  {
      prompt(message, 'alert-danger', time);
  };

  // 提醒
  var warning_prompt = function(message, time)
  {
      prompt(message, 'alert-warning', time);
  };

  // 信息提示
  var info_prompt = function(message, time)
  {
      prompt(message, 'alert-info', time);
  };

</script>


<!-- fancybox -->
<script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
<script>
  let LAZY_LOAD_IMAGE = "";
  $(".article-entry").find("fancybox").find("img").each(function () {
      var element = document.createElement("a");
      $(element).attr("data-fancybox", "gallery");
      $(element).attr("href", $(this).attr("src"));
      /* 图片采用懒加载处理时,
       * 一般图片标签内会有个属性名来存放图片的真实地址，比如 data-original,
       * 那么此处将原本的属性名src替换为对应属性名data-original,
       * 修改如下
       */
       if (LAZY_LOAD_IMAGE) {
         $(element).attr("href", $(this).attr("data-original"));
       }
      $(this).wrap(element);
  });
</script>





  <script>setLoadingBarProgress(100);</script>
</body>
</html>
